package com.kernel.web.view;

import com.kernel.web.context.WebContext;

import javax.servlet.http.HttpServletRequest;

/****************************************
 * @name ViewData
 * @description 需要发送到客户端显示的数据模型
 * @author 黄彬恒
 * @since 2018/7/19
 ***************************************/
public class ViewData {
    private HttpServletRequest request;

    public ViewData() {
        initRequest();
    }

    private void initRequest(){
        //从requestHolder中获取request对象
        this.request = WebContext.requestHolder.get();
    }

    public void put(String name,Object value){
        this.request.setAttribute(name, value);
    }
}
